package com.cj.ctyl.controller;

import com.cj.ctyl.entity.SysUsers;
import com.cj.ctyl.framework.utils.UserUtils;
import com.cj.ctyl.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: Alex
 * @Description: 主
 * @Date: 2021/8/14
 */
@Controller
public class IndexController {

    @Autowired
    private SysUserService sysUserService;

    @RequestMapping("/")
    public String index(ModelMap map) {
        SysUsers sysUsers = sysUserService.selectSysUserById(UserUtils.getSysUsers().getId());
        map.put("user", sysUsers);
        return "/index";
    }

    @RequestMapping("/main")
    public String main() {
        return "/main";
    }
}
